package org.blogwu.learn.multithread.chapter3.demo19;

import java.util.Random;

public class LocalThread extends Thread {

    static ThreadLocal<Random> tl = new ThreadLocal<Random>() {
        @Override
        protected Random initialValue() {
            return new Random(123);
        }
    };

    @Override
    public void run() {
        for (int i = 0; i < 100000; i++) {
            tl.get().nextInt();
        }
        System.out.println("over");
    }

}
